package com.shd.edanpei.bean;

import android.os.Parcel;
import android.os.Parcelable;

import com.shd.edanpei.common.Constant;
import com.shd.edanpei.util.DateUtils;

public class MessageModel implements Parcelable {

    private String content;
    private long createTime;
    private int id;
    private String picTure;
    private String title;
    private String type;
    private long updateTime;
    private boolean status;
    private String message;
    private int orderId;
    private int orderType;
    private String modelMsg;
    private int modelType;
    private String summary;



    protected MessageModel(Parcel in) {
        content = in.readString();
        createTime = in.readLong();
        id = in.readInt();
        picTure = in.readString();
        title = in.readString();
        type = in.readString();
        updateTime = in.readLong();
        status = in.readByte() != 0;
        message = in.readString();
        orderId = in.readInt();
        orderType = in.readInt();
        modelMsg = in.readString();
        modelType = in.readInt();
        summary=in.readString();
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(content);
        dest.writeLong(createTime);
        dest.writeInt(id);
        dest.writeString(picTure);
        dest.writeString(title);
        dest.writeString(type);
        dest.writeLong(updateTime);
        dest.writeByte((byte) (status ? 1 : 0));
        dest.writeString(message);
        dest.writeInt(orderId);
        dest.writeInt(orderType);
        dest.writeString(modelMsg);
        dest.writeInt(modelType);
        dest.writeString(summary);
    }

    @Override
    public int describeContents() {
        return 0;
    }

    public static final Creator<MessageModel> CREATOR = new Creator<MessageModel>() {
        @Override
        public MessageModel createFromParcel(Parcel in) {
            return new MessageModel(in);
        }

        @Override
        public MessageModel[] newArray(int size) {
            return new MessageModel[size];
        }
    };

    public String getContent() {
        return content;
    }

    public String getCreateTime() {
        return DateUtils.formatTime(createTime, Constant.Time.YYYY_MM_DD.getTime());
    }

    public int getId() {
        return id;
    }

    public String getPicTure() {
        return picTure;
    }

    public String getTitle() {
        return title;
    }

    public String getType() {
        return type;
    }

    public boolean isStatus() {
        return status;
    }

    public void setStatus(boolean status) {
        this.status = status;
    }

    public String getMessage() {
        return message;
    }

    public int getOrderId() {
        return orderId;
    }

    public int getOrderType() {
        return orderType;
    }

    public String getModelMsg() {
        return modelMsg;
    }

    public int getModelType() {
        return modelType;
    }

    public String getSummary() {
        return summary;
    }

    public void setSummary(String summary) {
        this.summary = summary;
    }
}
